home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / amos / eaissu3b.lha / Source_Code / UN_Etch_A_Sketch.AMOS / UN_Etch_A_Sketch.amosSourceCode < prev   
AMOS Source Code  |  1995-12-30  |  2KB  |  86 lines

  1. ' The Famous Bet-A-Sketch  
  2. '  
  3. ' Written in the equally famous
  4. '
  5. ' AMOS Basic. June 1992
  6. '
  7. ' Escape quits program 
  8. ' use a joystick to draw fire button erases
  9. ' or else click on dials with left button for clockwise
  10. '                             right button for anticlockwise 
  11. '                             delete key erases
  12. '
  13. Unpack 2 To 0
  14. Reserve Zone 2
  15. Set Zone 1,59,165 To 80,187
  16. Set Zone 2,239,165 To 260,187
  17. '
  18. Global X,Y,W,B,CW,CB
  19. X=160 : Y=100 : W=2 : B=7 : Ink 0
  20. '
  21. Double Buffer : Autoback 1
  22. '
  23. Do 
  24.    '
  25.    If Key State(69) Then _QUIT
  26.    If(Jleft(1) and X>44) or(Mouse Zone=1 and Mouse Key=2 and X>44)
  27.       Dec X
  28.       Inc CW
  29.       If CW=5
  30.          Add W,-1,2 To 6
  31.          CW=0
  32.       End If 
  33.    End If 
  34.    If(Jright(1) and X<274) or(Mouse Zone=1 and Mouse Key=1 and X<274)
  35.       Inc X
  36.       Inc CW
  37.       If CW=5
  38.          Add W,1,2 To 6
  39.          CW=0
  40.       End If 
  41.    End If 
  42.    If(Jup(1) and Y>14) or(Mouse Zone=2 and Mouse Key=1 and Y>14)
  43.       Dec Y
  44.       Inc CB
  45.       If CB=5
  46.          Add B,1,7 To 11
  47.          CB=0
  48.       End If 
  49.    End If 
  50.    If(Jdown(1) and Y<151) or(Mouse Zone=2 and Mouse Key=2 and Y<151)
  51.       Inc Y
  52.       Inc CB
  53.       If CB=5
  54.          Add B,-1,7 To 11
  55.          CB=0
  56.       End If 
  57.    End If 
  58.    If Fire(1) or Key State(70) Then _ERASE
  59.    Plot X,Y
  60.    Bob 1,70,176,W
  61.    Bob 2,249,176,B
  62.    Wait Vbl 
  63.    Amal Off 1
  64.    '
  65. Loop 
  66. '
  67. Procedure _ERASE
  68.    Channel 1 To Screen Display 0
  69.    RUB1$="Move 0,50,5 ; Move 0,-50,5"
  70.    Amal 1,RUB1$
  71.    Amal On 1
  72.    Sam Play 1
  73.    For N=1 To 100
  74.       RX=Rnd(243) : RY=Rnd(120)
  75.       If RX>43 and RY>13
  76.          Paste Bob RX,RY,1
  77.       End If 
  78.    Next N
  79.    Ink 1
  80.    Box 44,14 To 274,151
  81.    Ink 0
  82. End Proc
  83. Procedure _QUIT
  84.    Default 
  85.    Edit 
  86. End Proc